<?php
namespace Seller\Model;
use Think\Model;
use Think\Upload;
class GoodsModel extends Model 
{
	public $tableName = 'goods';

	/*商品上新*/
	public function goodsIn($arr)
	{
		$goodsModel    	 = M($this->tableName);
		$class['name'] = $arr['type'];

		$classModel = M('class');
		$classRes = $classModel->where($class)->select();

		$arr['class_id'] = $classRes[0]['class_id'];

		$goods_in = $goodsModel->data($arr)->add();
		if($goods_in)
		{
			return 'success';
		}else
		{
			return 'err';
		}
	}
}